<?php
include("admin/cls/cls_user.php");
session_start();
$correo=$_POST["email"];
$contrasenha=$_POST["password"];
$usuario = new cls_user();
//obtenemos los datos de la consulta
$var=$usuario->loginUser($correo,$contrasenha);

//recorres para obtener los datos
while($mostrar = mysql_fetch_array($var)){
$user_id=$mostrar['user_id'];
$email=$mostrar['email'];
$password=$mostrar['password'];
echo "id usuario".$user_id;
echo "id email".$email;
echo "id pass".$password;
}

if($correo==$email && $contrasenha=$password){
$create_session="1234";
$_SESSION["create_session"]="1234";
$_SESSION["user"]=$user_id;

/*
session_register($create_session);
session_register($user_id);
session_register($user_id);
session_register($email);*/

echo"
<script>
document.write(window.location='home.php');
</script>";
echo "sientra";
}
else
{
echo"
<script>
document.write(window.location='index.php');
</script>";
}
?>